import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';


class ClickableText extends Container {
  String text;
  VoidCallback onClick;
  final TextStyle? style;

  ClickableText({required this.text, required this.onClick,this.style});

  @override
  Widget build(BuildContext context) {
    String text = this.text;

    VoidCallback onClick = this.onClick;
    if (onClick == Null) {
      onClick = () {};
    }

    return new Container(
      alignment: Alignment.center,
      child: GestureDetector(
        child: Text(text,style: style,),
        onTap: onClick,
      ),
    );
  }
}